# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=kubectl-oidc_login
pkgver=1.28.0
pkgrel=5
pkgdesc="kubectl plugin for Kubernetes OpenID Connect authentication"
url="https://github.com/int128/kubelogin"
arch="all !armhf !riscv64" # blocked by kubectl
license="Apache-2.0"
depends="kubectl"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/int128/kubelogin/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/kubelogin-$pkgver"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -v -ldflags "-X main.version=$pkgver"
}

check() {
	go test ./...
}

package() {
	install -Dm755 kubelogin "$pkgdir"/usr/bin/kubectl-oidc_login
}

sha512sums="
b39cdb31aab7cb1bedbf5d13a449e289569b6e17c319900d18e741aeb8b88a8eee5534aec57753457e6a5b9b139b85b95f2bdb438b79773a8ae54e3eb57a4358  kubectl-oidc_login-1.28.0.tar.gz
"
